import {createLogger, format, transports} from 'winston';

// 创建日志记录器
export default createLogger({
    level: 'info',
    format: format.combine(
        format.timestamp(),
        format.printf(({timestamp, level, message}) => {
            return `${timestamp} [${level}]: ${message}`;
        })
    ),
    transports: [
        new transports.File({filename: 'log.txt'})
    ]
});
